﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UAgentMacStockDetailNGAdd.aspx.cs" Inherits="IHISCETeim.Web.AgentSys.SvrMgr.UAgentMacStockDetailNGAdd" %>
<style>
    
    .XZJobTrainDetailtable{border:solid #000; border-width:1px;border-collapse: collapse; }
    .XZJobTrainDetailtable th{border:solid #000; border-width:1px; line-height:20px; padding:2PX; font-weight:bold;}
    .XZJobTrainDetailtable td 
    {
        border-bottom: 1px solid #000;
        border-right: 1px solid #000;
        line-height: 21px;
        overflow: hidden;
        padding: 0 3px;   
    }
</style>
<div class="pageContent" style="border:1px #B8D0D6 solid;" >
    <form method="post" action="SvrMgr/UAgentMacStockDetailNGAdd.aspx?ajaxmethod=<%=Action %>&UASID=<%=UASID %>&UASDID=<%=UASDID %>&Action=<%=Action %>" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone)">
    <div class="pageFormContent" layoutH="66">        
        <table  style="width:100%">
              <tr>
                <td  style=" line-height:25px;">入库时间：</td>
                <td   style=" line-height:25px;">
                    <input type="text"  class="" readonly value="<%=UAgentMacStockObj.IntoStockDate.Replace(" 0:00:00","") %>"  />
                </td>                
                <td  style=" line-height:25px;">经销商</td>
                <td  style=" line-height:25px;">
                     <input type="text" class="" readonly value="<%=UAgentMacStockObj.AgentName %>"  />
                </td>
                 <td  style=" line-height:25px;"></td>
                <td  style=" line-height:25px;">
                    
                </td>
            </tr>
            <tr>
                <td  style=" line-height:25px;">型号：</td>
                <td   style=" line-height:25px;">
                    <%=UAgentMacStockObj.MacType %>
                </td>                
                <td  style=" line-height:25px;">机号：</td>
                <td  style=" line-height:25px;">
                    <input type="text"  class="" readonly value="<%=UAgentMacStockObj.SerialNumber %>"/>
                </td>
                 <td  style=" line-height:25px;"></td>
                <td  style=" line-height:25px;">
                   
                </td>
            </tr>
            <tr>
                <td  style=" line-height:25px;">定检日期：</td>
                <td   style=" line-height:25px;">
                    <input type="text" name="CheckDate" class="date required" value="<%=UAgentMacStockDetailObj.CheckDate %>"/>
                </td>                
                <td  style=" line-height:25px;">定检人员：</td>
                <td  style=" line-height:25px;">
                    <input type="text" name="RealName" class="textInput" alt=""  value="<%=UAgentMacStockDetailObj.RealName %>"/>
                </td>
                 <td  style=" line-height:25px;"></td>
                <td  style=" line-height:25px;">
                   
                </td>
            </tr>
            <tr>
                <td colspan="6">
                    <div style="color:red; font-weight:bold; line-height:25px;">注意：只需对检查为错误的项进行打勾,并填写相应的处理记录等</div>
                    <table class="XZJobTrainDetailtable"  style="width:100%; ">
                        <tr>
                            <th width="10%">选择</th>                           
                            <th width="50%">检查项目</th>
                            <th width="40%">如异常，请说明及处理</th>
                        </tr>
                        <asp:repeater id="rpMenu" runat="server">
                        <ItemTemplate>
                              <tr>
                                <td  colspan="3" style="font-weight:bold; background-color:#ccc;">
                                   <%# Eval("Title")%>
                                </td>                                
                              </tr>
                             <%# GetSubTrainHtml(Eval("TempID"))%>
                            
                        </ItemTemplate>                       
                        </asp:repeater>
                    </table>
                </td>
            </tr>
        </table>
        <div style="color:red; font-weight:bold; line-height:25px;">注意：以下部份针对库存时间超过3个月的机器，请重点检查并提供相应的照片</div>
        <div>
            <%--<div style="float:left; width:160px; border:1px solid #000; margin-right:20px; ">
                <div style=" line-height:25px; height:25px; border-bottom:1px solid #000; padding:0px 5px;">机号</div>
                <div style="padding:5px;">
                    <a  class='imgUAgentMacNewNGAddimgShow' href='{5}'><img id='imgUAgentMacNewNGAddimgShow{0}' src='{5}' Width='150' Height='150'/></a>
                </div>
                <div style="padding:5px;">
                    <input type='hidden'   name='NGImg' id='imgUAgentMacNewNGAddNGImg' value='{5}'  />
                    <input type='file' name='filedata' id='imgUAgentMacNewNGAdd' upload='upload' clientId='imgUAgentMacNewNGAddimgShow,imgUAgentMacNewNGAddNGImg' dirtype='6' foldername='{6}' onUploadSuccess='onAgentQltyUploadImgSuccess' fileTypeDesc='只能上传图片' fileTypeExts='*.jpg;*.gif;*.jpeg;*.png;*.bmp' fileSizeLimit='1MB'/>
                     
                </div>
                <div style="padding:5px;">
                    <a href='#' onclick=""onUAgentMacNewNGAddDeleteImg('imgUAgentMacNewNGAddNGImg{0}','imgUAgentMacNewNGAddimgShow{0}')"">删除</a>
                </div>
            </div>--%>
              <asp:repeater id="rpNGImg" runat="server">
                        <ItemTemplate>
                             
                             <%# GetSubTrainHtml2(Eval("TempID"))%>
                            
                        </ItemTemplate>                       
                        </asp:repeater>
        </div>
       
        
    </div>
    <div class="formBar">
			<ul>	
                		
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<%--<div class="button"><div class="buttonContent"><button type="button" class="">导出</button></div></div>--%>
				</li>
			</ul>
		</div>    
    </form>
</div>
<script>
    $(document).ready(function () {
        $.pdialog.closeCurrent();
        $(":checkbox[name='checkselected']").change(function () {
            checkpagecheckboxXZJobTrainDetail();
        })

        checkpagecheckboxXZJobTrainDetail();

        $("a.imgUAgentMacStockDetailNGAddShow").fancybox();
        setTimeout(function () {
            $(":file[upload]").each(function () {
                uploadifyFun($(this));
            });
        }, 500)
    })

    function checkpagecheckboxXZJobTrainDetail() {

        $(":checkbox[name='checkselected']").each(function () {
            if ($(this).is(':checked')) {
                $(this).closest("tr").find(":text").removeAttr("disabled");
                $(this).closest("tr").find("select ").removeAttr("disabled");
                $(this).closest("tr").find("td").css("color", "red");
            }
            else {
                $(this).closest("tr").find(":text").attr("disabled", "disabled");
                $(this).closest("tr").find("select ").attr("disabled", "disabled");
                $(this).closest("tr").find("td").css("color", "#000");
            }
        })
    }

    function onUAgentMacStockDetailNGAddUploadImgSuccess(file, data, response) {
        if (!response)
            return false;
        data = eval("(" + data + ")");
        if (!data.uploadResult) {
            alert(data.errMsg);
            return;
        }
        var $imgUploadPath = data.filePath;
        var $trageIds = data.customerInfo.split(",");
        $("#" + $trageIds[0]).attr("src", $imgUploadPath);
        $("#" + $trageIds[1]).val($imgUploadPath);
        //
        $("#" + $trageIds[0]).closest("a").attr("href", $imgUploadPath).fancybox();
    }
    function onUAgentMacStockDetailNGAddDeleteImg(hiddenid, imgid) {
        $("#" + imgid).attr("src", "");
        $("#" + hiddenid).val("");
    }
</script>

